package com.ruoyi.quartz.task;

import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.AccessTokenUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 定时任务调度测试
 * 
 * @author ruoyi
 */
@Component("ZzwTask")
public class ZzwTask
{

    @Value("${minProgram.appId}")
    private String appid;
    @Value("${minProgram.serret}")
    private String secret;

    @Autowired
    private RedisCache redisCache;

    public  void getXcxToken()
    {
        String token = AccessTokenUtils.getXcxToken(appid,secret);
        redisCache.setCacheObject("token",token);
        Object tokenCache=redisCache.getCacheObject("token");
        System.out.println(String.valueOf(tokenCache));
    }
}
